package cn.kgc.microservicecloudconsumerdept80.service;

import cn.kgc.microservicecloudapi.pojo.BookCategory;
import cn.kgc.microservicecloudapi.pojo.ResultEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(name = "MICROSERVICECLOUD-PROVIDER-DEPT",fallbackFactory = CategoryClientServiceFallbackfactory.class)
public interface CategoryClientService {
    @RequestMapping("/provider/category/list")
    public ResultEntity<List<BookCategory>> list();
    @RequestMapping("/provider/category/get/{id}")
    public ResultEntity<BookCategory> get(@PathVariable(value = "id") Integer id);

    @RequestMapping("/provider/category/update")
    public ResultEntity<String> update(@RequestBody BookCategory category);

    @RequestMapping("/provider/category/insert")
    public ResultEntity<String> insert(@RequestBody BookCategory category);

    @RequestMapping("/provider/category/delete/{id}")
    public ResultEntity<String> delete(@PathVariable(value = "id") Integer id);

}
